package com.sc.sc250601.cook.service.impl;


import com.sc.sc250601.cook.mapper.BrowseRecordMapper;
import com.sc.sc250601.cook.pojo.BrowseRecord;
import com.sc.sc250601.cook.pojo.Recipe;
import com.sc.sc250601.cook.pojo.RecipeBrowseDTO;
import com.sc.sc250601.cook.service.BrowseRecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class BrowseRecordServiceImpl implements BrowseRecordService {
    @Autowired
    private BrowseRecordMapper browseRecordMapper;
    @Override
    public int recordBrowse(BrowseRecord record) {
        return browseRecordMapper.insertSelective(record);
    }

    @Override
    public List<RecipeBrowseDTO> getBrowseRecordByUserId(Long userId) {
        return browseRecordMapper.getRecipeListByUserId(userId);
    }


}
